"use server"

import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";


export async function DeleteWorkflow(id: string) {
    // const {userId} = auth()
    // if (!userId) {
        // throw new Error("unauthenticated")
    // }

    const userId = "test"

    await prisma.workflow.delete({
        where: {
            id,
            userId
        }
    })

    // 重新加载页面
    revalidatePath("/workflows")
}